package com.warpcode.gpsloggerlite;

import android.content.Context;
import android.database.Cursor;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CursorAdapter;
import android.widget.TextView;

public class LocationTrackerAdapter extends CursorAdapter 
{
	@SuppressWarnings("deprecation")
	public LocationTrackerAdapter(Context context,Cursor cursor)
	{
		super(context,cursor);        
    }
                
    @Override
    public void bindView(View view, Context context, Cursor cursor) 
    {                
    	TextView cov = (TextView) view.findViewById(R.id.coordinate);
        TextView id = (TextView) view.findViewById(R.id.id);
        id.setText(cursor.getString(0));
        cov.setText(""+cursor.getString(1));        
    }

    @Override
    public View newView(Context context, Cursor cursor, ViewGroup parent) 
    {
    	LayoutInflater inflater = LayoutInflater.from(parent.getContext());
    	View view = inflater.inflate(R.layout.location_list_item,parent,false);
    	return view;
    }
}
